package com.yupi.yupicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yupicturebackend.api.aliyunai.model.CreateOutPaintingTaskResponse;
import com.yupi.yupicturebackend.model.dto.picture.*;
import com.yupi.yupicturebackend.model.entity.Picture;
import com.yupi.yupicturebackend.model.entity.User;
import com.yupi.yupicturebackend.model.vo.picture.PictureVO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author MJB_Computer
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-06-05 19:31:44
*/
public interface PictureService extends IService<Picture> {
     PictureVO uploadPicture(Object  inputSource, PictureUploadRequest pictureUploadRequest, User loginUser);

     void deletePicture(long pictureId, User loginUser);

     void editPicture(PictureEditRequest pictureEditRequest, User loginUser);

     public QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);

     PictureVO getPictureVO(Picture picture, HttpServletRequest request);

     //分页获取图片封装
     Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

     //编写图片数据校验方法，用于更新和修改图片是进行判断
     void validPicture(Picture picture);
     //上传图片审核
     void doPictureReview(PictureReviewRequest pictureReviewRequest,User loginUser);

     //设置审核状态通用方法
     void fileReviewParams(Picture picture, User loginUser);
     Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User loginUser);

    void clearPictureFile(Picture oldPicture);

     //根据颜色查询图片
     List<PictureVO> searchPictureByColor(Long spaceId, String picColor, User loginUser);

     void checkPictureAuth(User loginUser, Picture picture);

    @Transactional(rollbackFor = Exception.class)
    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);

    /*ai扩图*/
    CreateOutPaintingTaskResponse createOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, User loginUser);
}
